package cn.byapps.hw.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@DiscriminatorValue("A")
@Data
@AllArgsConstructor
@NoArgsConstructor

/**
 * 课后作业实体类
 */
public class Homework extends Assignment {

    @Column(name = "requirement", length = 200)
    private String requirement = "";// 要求
    @ManyToOne
    @JoinColumn(name = "serialPK_id")
    private SerialPK serialPK;

    @OneToMany(mappedBy = "homework")
    private Set<HomeworkFile> homeworkFiles = new HashSet<>();
    @OneToMany(mappedBy = "homework")
    private Set<HomeworkRequirement> teacherFiles = new HashSet<HomeworkRequirement>();// 教师作业附件实体
}